type SystemType = 'school' | 'company';
type BuildType = 'dev' | 'prod' | 'test' | 'proxy';

// 获取环境变量并检查它们是否有效
const systemTypeEnv = import.meta.env.VITE_SYSTEM_TYPE;
const buildTypeEnv = import.meta.env.VITE_BUILD_MODE;

// 验证环境变量的值是否符合定义的类型
const systemType: SystemType =
  systemTypeEnv === 'school' || systemTypeEnv === 'company' ? systemTypeEnv : 'school';
const buildType: BuildType =
  buildTypeEnv === 'dev' ||
  buildTypeEnv === 'prod' ||
  buildTypeEnv === 'test' ||
  buildTypeEnv === 'proxy'
    ? buildTypeEnv
    : 'dev';

export { buildType, systemType };
